-
Notifications
You must be signed in to change notification settings - Fork 32
Create TypeScript declarations from JSDoc #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
package.json
Outdated
@@ -11,7 +11,8 @@ | |||
"lint": "xo", | |||
"test": "xo && ava", | |||
"report": "nyc ava", | |||
"coverage": "nyc --reporter json --reporter text ava && codecov -f coverage/coverage-final.json" | |||
"coverage": "nyc --reporter json --reporter text ava && codecov -f coverage/coverage-final.json", | |||
"prepublishOnly": "npx typescript --declaration --emitDeclarationOnly --allowJs index.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will use the globally installed version if there is one, or download the latest version. I think it would be better if we could pin a version by adding typescript
to our devDependencies
, and then referring to that one here:
"prepublishOnly": "npx typescript --declaration --emitDeclarationOnly --allowJs index.js" | |
"prepublishOnly": "tsc --declaration --emitDeclarationOnly --allowJs index.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can pin TypeScript version at npx: npx typescript@latest ...
if a lower version on a published system is the concern? We need it only before publishing, so, not sure if it better to include and maintain TypeScript as a dependency...
@LinusU @jimmywarting merging? |
I personally feel that this should be a dev-dependency instead of installed on demand using Is there any downside to adding |
Well, they almost the same as benefits:
I don't understand why you will not be able to review output if it will be produced by the same command |
@tinovyatkin Maybe we can add |
@xxczaki I've added I understand that |
This PR drops manually created and maintained TypeScript typing in favor of automatically generated from JSDoc.
Run
npm run prepublishOnly
to inspect new one.Also drops reference to
dom.lib
as discussed innode-fetch
.